var base = require('./baseTest');
var moment = require('moment');
var config = require('../conf/config');
var period = config.constant.period;
var scheduleDate = require('../util/scheduleDate');


var recalculateNextRemindTimeTest = function(){
    console.info('recalculateNextRemindTimeTest======================================================================');

    for (var key in period) {
        console.info('---%s',period[key]);
        var date = scheduleDate.recalculateNextRemindTime(moment('2014-10-12 12:12:12').toDate(), 15, period[key]);
        console.info('|-%s' ,moment(date).format('YYYY-MM-DD HH:mm:ss'));
    }
};

var nextExecTimeTest = function(){
    console.info('nextExecTimeTest======================================================================');

    for (var key in period) {
        console.info('---%s',period[key]);
        var date = scheduleDate.nextExecTime({alarm:moment('2014-10-12 12:12:12').toDate(), repeat : period[key]}).alarm;
        console.info('|-%s' ,moment(date).format('YYYY-MM-DD HH:mm:ss'));
    }
};

base.exec(recalculateNextRemindTimeTest, nextExecTimeTest);
